package com.lg.spring.ioc;

import com.lg.domain.User;
import lombok.SneakyThrows;

import java.beans.BeanInfo;
import java.beans.Introspector;
import java.beans.PropertyDescriptor;

/**
 * 依赖注入 原理，还是对jdk方法的封装
 */
public class Ioc {
    @SneakyThrows
    public static void main(String[] args) {
//        BeanInfo beanInfo = Introspector.getBeanInfo(User.class);
        BeanInfo beanInfo = Introspector.getBeanInfo(User.class,Object.class);

        PropertyDescriptor[] propertyDescriptors = beanInfo.getPropertyDescriptors();
        for (PropertyDescriptor propertyDescriptor : propertyDescriptors) {
            System.out.println(propertyDescriptor);

            System.out.println(propertyDescriptor.getName());
            System.out.println(propertyDescriptor.getPropertyType());
        }
    }
}
